package com.wfs.common.wechat.util;

import org.weixin4j.Configuration;

/**
 * @author 赵飞
 * @version V1.0
 * @Title:
 * @Package com.wfs.common.wechat.util
 * @Description:
 * @date 2017/3/29
 */
public class WeChatUrl {



	public static String getOpenIdByCodeUrl(String appId,String code){
		return "https://api.weixin.qq.com/sns/oauth2/component/access_token?appid="+appId+"&code="+code+"&grant_type=authorization_code&component_appid="+ Configuration.getProperty("myweixin.component_appid") +"&component_access_token="+AccessTokenUtil.getComponentAccessToken();
	}

	public static String getUserInfoUrl(String appId,String openId){
		return "https://api.weixin.qq.com/cgi-bin/user/info?access_token="+AccessTokenUtil.getAuthorizerAccessToken(appId)+"&openid="+openId+"&lang=zh_CN";
	}
}
